import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {CommonTool} from '../../common/common.tool';
import {HTTP_URLS} from '../../base/base-http.url';

@Injectable({
  providedIn: 'root'
})
export class ShareFileService {

  constructor(private http: HttpClient,
              public commonTool: CommonTool) {

  }

  /**
   * 获取系统文件集合
   */
  public inspectShareFile(fid) {
    return this.http.get<any>(HTTP_URLS.inspectShareFile + fid);
  }

  /**
   * 获取系统文件集合
   */
  public shareVerify(req) {
    return this.http.post<any>(HTTP_URLS.shareVerify, req);
  }

  /**
   * 查询共享文件
   */
  public shareFile(fid, req) {
    return this.http.get<any>(this.commonTool.getParam(HTTP_URLS.shareFile + fid, req));
  }
}
